<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        /*
            Object.values(obj);
                - 拿到obj里面所有的值，以数组形式返回
            Object.entries(obj);
                - 以[ [ key1 , value1 ] , [ key2 , value2 ]...]的形式返回obj的键值对
                - 用处在于更方便将对象转为Map类型，let map = new Map(Object.entries(obj))
        */
        let obj = {
            name: 'mikaisaa',
            age: 18
        }
        console.log(Object.values(obj));

        console.log('----------------------------------------');
        
        let map  = new Map(Object.entries(obj));
        console.log(Object.entries(obj),map);
    </script>
</body>

</html>